#ifndef _L_EQUATION_111225_H
#define _L_EQUATION_111225_H

#include <ltypes.h>
#include <lmacros.h>
#include <lmath.h>

#include <vector>

LLIB_BEGIN;
namespace math {

// EquationSolver solves the real number root of equations with degree of 1, 2 or 3
class EquationSolver {
public:
    // solve the real number root of a cubic equation
    static std::vector<Float> SolveCubicEquation            (const Float A, const Float B, const Float C, const Float D);
    // solve the real number root of a quadratic equation
    static std::vector<Float> SolveQuadraticEquation        (const Float A, const Float B, const Float C);
    // solve the root of a linear equation
    static std::vector<Float> SolveLinearEquation           (const Float A, const Float B);
private:
    static std::vector<Float> SolveCubicEquation_base       (const Float A, const Float B, const Float C, const Float D);
    static std::vector<Float> SolveQuadraticEquation_base   (const Float A, const Float B, const Float C);
    static std::vector<Float> SolveLinearEquation_base      (const Float A, const Float B);
};

} // end of namespace math
LLIB_END

#endif